import turtle

def draw_square(side_length=100, line_color="black", fill_color="white", line_width=2):
    # 设置画布
    screen = turtle.Screen()
    screen.title("正方形")
    screen.bgcolor("lightgray")
    
    # 创建画笔
    pen = turtle.Turtle()
    pen.speed(3)  # 绘制速度
    pen.color(line_color, fill_color)  # 线条颜色和填充颜色
    pen.pensize(line_width)  # 线条粗细
    
    # 开始绘制正方形
    pen.begin_fill()
    for _ in range(4):  # 循环4次，绘制四条边
        pen.forward(side_length)  # 向前移动指定长度
        pen.left(90)  # 向左旋转90度（正方形每个角都是90度）
    pen.end_fill()
    
    # 隐藏画笔
    pen.hideturtle()
    # 保持窗口打开
    screen.mainloop()

# 调用函数绘制正方形，可自定义参数
draw_square(
    side_length=150,    # 边长
    line_color="darkgreen",  # 线条颜色
    fill_color="lightgreen",  # 填充颜色
    line_width=3  # 线条粗细
)
